feat(client): impl Debug for Client#430
Conversation
|
|
There was a problem hiding this comment.
Pull request overview
Implements a manual Debug for Client to unblock downstream #[derive(Debug)] use cases while avoiding leaking sensitive client configuration.
Changes:
- Added
#[derive(Debug)]toProductInfoto support debug output. - Implemented a manual
DebugforClientthat omits non-debuggable/internal fields and redacts auth/header values. - Added unit tests to validate debug formatting and redaction behavior.
Comments suppressed due to low confidence (1)
src/lib.rs:134
- When the
test-utilfeature is enabled,Clienthas amocked: boolfield that affects behavior (seewith_urlhandling of mocked URLs). The manualDebugimpl currently hides it, which makes debugging tests harder. Consider includingmockedbehind the same cfg in theDebugoutput (it’s not sensitive and is trivially debuggable).
.field("compression", &self.compression)
.field("roles", &self.roles)
.field("settings", &self.settings)
.field("headers", &self.headers.keys())
.field("products_info", &self.products_info)
.field("validation", &self.validation)
.finish_non_exhaustive()
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
hi @abonander friendly ping on this! |
abonander
left a comment
There was a problem hiding this comment.
I think we'll end up improving this over time but since Debug doesn't need to be stable, having something is better than nothing.
|
@zachschuermann looks like you still need to sign the CLA (see above). And rebase as well, please. |
|
This is ready to merge otherwise, but it still says you haven't signed the CLA. Did you do it and it just hasn't updated? |
Summary
Implement
DebugforClient.Since
Clienthas both sensitive information and some non-debugable fields we manuallyimpl Debugby:#[derive(Debug)]onProductInfoinsert_metadata_cacheauthorization,headersvalues, and only printingurl.originto avoid leaking user/passFixes #429
Checklist